home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Suzy B Software 2
/
Suzy B Software CD-ROM 2 (1994).iso
/
extras
/
programm
/
gemfsc20
/
gemfsc20.lzh
/
GEMFUNCS
/
OBJSTCHG.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-03-20
|
1KB
|
56 lines
/**************************************************************************
* OBJSTCHG.C - Change object state, with optional redraw.
*************************************************************************/
#include "gemfintl.h"
#ifdef GEMFAST_PROTOS
void obj_stchange(OBJECT *ptree, short object, short newstate,
short drawflag, ...)
#else
void obj_stchange(ptree, object, newstate, drawflag)
register OBJECT *ptree;
short object;
short newstate;
short drawflag;
#endif
{
GRECT *optional_clip;
GRECT *pclip;
va_list args;
va_start(args, drawflag);
optional_clip = va_arg(args, GRECT *);
va_end(args);
/*
* check the newstate value. if the high bit is set, AND the newstate
* with the current state, else OR them.
*/
if (newstate & 0x8000) {
newstate &= ptree[object].ob_state;
}
else {
newstate |= ptree[object].ob_state;
}
/*
* if the drawflag is set, redraw the object.
* if the drawflag says a clipping rectangle was passed, use it,
* else use root object as the clipping rectangle for the redraw.
*/
if (drawflag == OBJ_CLIPDRAW) {
drawflag = OBJ_WITHDRAW; /* xlate from 2 to 1 */
pclip = optional_clip;
} else {
pclip = (GRECT *)&ptree->ob_x;
}
objc_change(ptree, object, 0, RECTVALS(pclip), newstate, drawflag);
}